<template>
	<view :data-theme="theme">
		<!-- #ifndef APP-PLUS -->
		<!-- <nav-bar :navTitle='navTitle'></nav-bar> -->
		<!-- #endif -->
		<!-- :style="'margin-top:'+homeTop+'rpx'" -->
		<view class='order-submission' >
			<view class="allAddress" v-if="pdType==1" :style="store_self_mention ? '':'padding-top:10rpx;'">
				<view class="nav acea-row">
					<view class="item font_color" :class="shippingType == 0 ? 'on' : 'on2'" @tap="addressType(0)"
						v-if='store_self_mention'></view>
					<view class="item font_color" :class="shippingType == 1 ? 'on' : 'on2'" @tap="addressType(1)"
						v-if='store_self_mention'></view>
				</view>
				<view class='address acea-row row-between-wrapper' @tap='onAddress' v-if='shippingType == 0' :style="store_self_mention ? '':'border-top-left-radius: 14rpx;border-top-right-radius: 14rpx;'">
					<view class='addressCon' v-if="addressInfo.realName">
						<view class='name'>{{addressInfo.realName}}
							<text class='phone'>{{addressInfo.phone}}</text>
						</view>
						<view class="acea-row">
							<text class='default font_color'
								v-if="addressInfo.isDefault">[默认]</text>
							<text class="line2">{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.detail}}</text>	
						</view>
					</view>
					<view class='addressCon' v-else>
						<view class='setaddress'>设置收货地址</view>
					</view>
					<view class='iconfont icon-jiantou'></view>
				</view>
				<view class='address acea-row row-between-wrapper' v-else @tap="showStoreList">
					<block v-if="storeList.length>0">
						<view class='addressCon'>
							<view class='name'>{{system_store.name}}
								<text class='phone'>{{system_store.phone}}</text>
							</view>
							<view class="line1"> {{system_store.address}}{{", " + system_store.detailedAddress}}
							</view>
						</view>
						<view class='iconfont icon-jiantou'></view>
					</block>
					<block v-else>
						<view>暂无门店信息</view>
					</block>
				</view>
				<view class='line'>
					<image src='/static/images/line.jpg'></image>
				</view>
			</view>
			<view class="pad30" style="padding-bottom: 50px;">
				<orderGoods :cartInfo="cartInfo" :orderProNum="orderProNum" :type="pdType"></orderGoods>
				<view v-if="pdType!=1" class="wrapper borRadius14" >
					<view style="padding-bottom: 5px;">
						<view class="row" style="align-items: center;">
							<view class="" style="font-size: 15px;margin: 5px 12px;color: #000;font-weight: 700;">
						      使用时间
							</view>
						</view>
					</view>
					<view class="" style="padding-bottom: 10px;">
						<view v-if="salesDates&&salesDates.length" class="listn acea-row row-middle">
							<view @click="selectDay(salesDates[0])" v-if="salesDates[0]" class="itemn2" :class="salesDates[0].selected === true ? 'on' : ''">
								<view class="weekday">
									<view>{{salesDates[0].week}}</view>
									<view>{{salesDates[0].dateSimple}}</view>
								</view>
								<view v-if="salesDates[0].selected === true" class="gou2">
									<text class="iconfont icon-dui" style="font-size: 10px;color: #FFFFFF;"></text>
								</view>
							</view>
							<view  @click="selectDay(salesDates[1])" v-if="salesDates[1]" class="itemn2" :class="salesDates[1].selected === true ? 'on' : ''">
								<view class="weekday">
									<view>{{salesDates[1].week}}</view>
									<view>{{salesDates[1].dateSimple}}</view>
								</view>
								<view v-if="salesDates[1].selected === true" class="gou2">
									<text class="iconfont icon-dui" style="font-size: 10px;color: #FFFFFF;"></text>
								</view>
							</view>
							<view  @click="selectDay(selectDayBean)" v-if="selectDayBean.dateSimple&&selectDayBean.date!=salesDates[0].date&&selectDayBean.date!=salesDates[1].date&&selectDayBean.date!=salesDates[2].date" class="itemn2" :class="selectDayBean.selected === true ? 'on' : ''">
								<view class="weekday">
									<view>{{selectDayBean.week}}</view>
									<view>{{selectDayBean.dateSimple}}</view>
								</view>
								<view v-if="selectDayBean.dateSimple&&selectDayBean.date!=salesDates[0].date&&selectDayBean.date!=salesDates[1].date&&selectDayBean.date!=salesDates[2].date" class="gou2">
									<text class="iconfont icon-dui" style="font-size: 10px;color: #FFFFFF;"></text>
								</view>
							</view>
							<view @click="selectDay(salesDates[2])"  v-else-if="salesDates[2]"  class="itemn2" :class="salesDates[2].selected === true ? 'on' : ''">
								<view class="weekday">
									<view>{{salesDates[2].week}}</view>
									<view>{{salesDates[2].dateSimple}}</view>
								</view>
								<view v-if="salesDates[2].selected === true" class="gou2">
									<text class="iconfont icon-dui" style="font-size: 10px;color: #FFFFFF;"></text>
								</view>
							</view>
							<view @click="calendarShow=true"  v-if="salesDates&&salesDates.length>=3" class="more_date row-center" >
								<view class="weekday">
									<view>更多</view>
									<view>日期</view>
								</view>
								<view class="iconfont icon-jinrujiantou "></view>
							</view>
						</view>
						<view v-else style="text-align: center;color: #fa2508;">
							暂无售卖日期
						</view>
					</view>
					<!-- <view style="padding-bottom: 5px;">
						<view class="row" style="align-items: center;">
							<view class="" style="font-size: 15px;margin: 5px 12px;color: #000;font-weight: 700;">
						      购买数量
							</view>
						</view>
					</view> -->
					<view class="display-flex" style=" margin-top: 15px;">
						<view style="padding-bottom: 5px;">
							<view class="row" style="align-items: center;">
								<view class="" style="font-size: 15px;margin: 5px 12px;color: #000;font-weight: 700;">
							      购买数量
								</view>
							</view>
						</view>
						<view class="" style="margin-left: auto;">
							<view class="cart acea-row row-between-wrapper" style="margin-right: 12px;">
								<view class="carnum acea-row row-left">
									<view class="item2 reduce" :class="peopleNum <= 1 ? 'on' : ''"
										@click="CartNumDes">
										-
									</view>
									<view class='item2 num'>
										<input type="number" v-model="peopleNum"
											data-name="productSelect.cart_num"
											@input="bindCode(peopleNum)" maxlength="3"></input>
									</view>
									<view class="item2 plus"  @click="CartNumAdd">
										+
									</view>
								</view>
							</view>
							<!-- <view style="margin-right: 12px;float: right;margin-bottom: 10px;">
								<text style="color: #828282;x">单价：</text>￥{{cartInfo?cartInfo[0].price:''}}
							</view> -->
						</view>
					</view>
					
				</view>
				
				
				<view v-if="isPassenger" class="" style="background-color: #FFFFFF;margin-top: 10px;border-radius: 5px;">
					<view style="padding-bottom: 5px;">
						<view class="row" style="align-items: center;background-color: #d9efff;border-top-left-radius: 5px;border-top-right-radius: 5px;">
							<view class="" style="font-size: 15px;margin: 5px 12px;color: #000;font-weight: 700;">
							游客信息
							</view>
							<view style="color: #a3a3a3;font-size: 12px;">需填写<text style="color: #cc1616;">{{peopleNum}}</text>位，用于身份验证</view>
							
						</view>
						<view @click="passengerShow=true" v-if="passengerList&&!passengerList.length" class="" style="border-radius: 5px;height: 35px;line-height: 35px;color: #FFFFFF;margin: 10px;background-color: #007AFF;text-align: center;">
							<view><text class="iconfont iconkuaidiyuan-xianxing"></text>添加游客</view>
						</view>
						<view v-else  style="display: flex;flex-flow: wrap;margin: 10px 12px;">
							<view @click="selectPassenger(index)"  :class="item.check?'in-active':'no-active'" v-for="(item,index) in passengerList" :key="index" style="">
								<text>{{item.name}}</text>
								<view v-if="item.check" class="gou">
									<text class="iconfont icon-dui" style="font-size: 10px;color: #FFFFFF;"></text>
								</view>
								<text style="display: none;">{{flag}}</text>
							</view>
							
							
							<view @click="passengerShow=true" class="no-active" style="">
								更多<text class="iconfont icon-jinrujiantou" style="font-size: 12px;"></text>
							</view>
						</view>
						<view class="">
							
							<view v-if="item.check" class="" v-for="(item, index) in passengerList" :key=index>
								<view class="row-center" style="margin: 5px 12px;">
									<text @click="delectPassenger(index)" class="iconfont icon-shanchu" style="color: #ff0004;margin: 0 10px 0 5px;"></text>
									<text style="font-size: 14px;color: #000000;font-weight: 600;width: 90px;">{{item.name}}</text>
									<text style="color: #909090;font-size: 12px;margin: 0 5px;margin-right: 32px;">{{item.idCard.substr(0,4) + "**********" + item.idCard.substr(14),}}</text>
									<view class="" style="width: 80px;height: 20px;line-height: 20px;font-size: 12px;background-color: #e4f4ff;color: #b5cdff;text-align: center;margin-right: 10px;">
										{{item.type==1?'成人票':'儿童票'}}
									</view>
									<text  @click="editPassenger(item)"  class="iconfont icon-xiugai" style="margin-left: auto;font-size: 18px;color: #007AFF;"></text>
								
								</view>
								<view v-if="index!=(passengerList.length-1)" class="separation-line" style="margin: 12px;">
									
								</view>
							</view>
										
							
						</view>
						
					
					</view>
				</view>
				
				
				<view class='wrapper borRadius14'>
					<view class='item acea-row row-between-wrapper' @tap='couponTap'
						v-if="!orderInfoVo.bargainId && !orderInfoVo.combinationId && !orderInfoVo.seckillId && productType==='normal'">
						<view>优惠券</view>
						<view class='discount'>{{couponTitle}}
							<text class='iconfont icon-jiantou'></text>
						</view>
					</view>
					
					<!-- <view class='item acea-row row-between-wrapper'
						v-if="!orderInfoVo.bargainId && !orderInfoVo.combinationId && !orderInfoVo.seckillId && productType==='normal'">
						<view>积分抵扣</view>
						<view class='discount acea-row row-middle'>
							<view> {{useIntegral ? "剩余积分":"当前积分"}}
								<text class='num font_color'>{{useIntegral ? orderInfoVo.surplusIntegral : orderInfoVo.userIntegral || 0}}</text>
							</view>
							<checkbox-group @change="ChangeIntegral">
								<checkbox :checked='useIntegral ? true : false' :disabled="orderInfoVo.userIntegral==0 && !useIntegral"/>
							</checkbox-group>
						</view>
					</view> -->
					<!-- <view class='item acea-row row-between-wrapper'
						v-if="priceGroup.vipPrice > 0 && userInfo.vip && !pinkId && !BargainId && !combinationId && !seckillId">
						<view>会员优惠</view>
						<view class='discount'>-￥{{priceGroup.vipPrice}}</view>
					</view> -->
					<view class='item acea-row row-between-wrapper' v-if='shippingType==0'>
						<view>快递费用</view>
						<view class='discount' v-if='parseFloat(orderInfoVo.freightFee) > 0'>
							+￥{{orderInfoVo.freightFee}}
						</view>
						<view class='discount' v-else>免运费</view>
					</view>
					<view v-else>
						<view class="item acea-row row-between-wrapper">
							<view>联系人</view>
							<view class="discount textR">
								<input type="text" placeholder="请填写您的联系姓名" placeholder-style="color:#ccc;" placeholder-class="placeholder"
									@blur='realName' maxlength="20"></input>
							</view>
						</view>
						<view class="item acea-row row-between-wrapper">
							<view>联系电话</view>
							<view class="discount textR">
								<input type="number" placeholder="请填写您的联系电话"  placeholder-style="color:#ccc;" placeholder-class="placeholder"
									@blur='phone' maxlength="11"></input>
							</view>
						</view>
					</view>
					<!-- <view class='item acea-row row-between-wrapper' wx:else>
					  <view>自提门店</view>
					  <view class='discount'>{{system_store.name}}</view>
					</view> -->
					<view class='item' v-if="textareaStatus">
						<view class="flex justify-between">
							<view>备注信息</view>
							<view>
								<text style="color:#666;">{{markNum ? markNum : 150}}</text>/<text>150</text>
							</view>
						</view>
						<textarea v-if="coupon.coupon===false" placeholder-class='placeholder' @input='bindHideKeyboard'
							value="" name="mark" placeholder='请添加备注（150字以内）'></textarea>
					</view>
				</view>
				<view class='wrapper borRadius14'>
					<view class='item'>
						<view>支付方式</view>
						<view class='list'>
							<view class='payItem acea-row row-middle' :class='active==index ?"on":""'
								@tap='payItem(index)' v-for="(item,index) in cartArr" :key='index'
								v-if="item.payStatus==1">
								<view class='name acea-row row-center-wrapper'>
									<view class='iconfont animated'
										:class='(item.icon) + " " + (animated==true&&active==index ?"bounceIn":"")'>
									</view>
									{{item.name}}
								</view>
								<view class='tip'>{{item.title}}</view>
							</view>
						</view>
					</view>
				</view>
				<view class='moneyList borRadius14'>
					<view class='item acea-row row-between-wrapper'>
						<view>产品总价：</view>
						<view class='money'>￥{{orderInfoVo.proTotalFee || 0}}</view>
					</view>
					<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.couponFee > 0">
						<view>优惠券抵扣：</view>
						<view class='money'>-￥{{orderInfoVo.couponFee}}</view>
					</view>
					<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.deductionPrice > 0">
						<view>积分抵扣：</view>
						<view class='money'>-￥{{orderInfoVo.deductionPrice}}</view>
					</view>
					<view class='item acea-row row-between-wrapper' v-if="orderInfoVo.freightFee > 0">
						<view>运费：</view>
						<view class='money'>+￥{{orderInfoVo.freightFee}}</view>
					</view>
				</view>
				<view style='height:120rpx;'></view>
			</view>
			<view class='footer acea-row row-between-wrapper'>
				<view>合计:
					<text class='price_color'>￥{{orderInfoVo.payFee || 0}}</text>
				</view>
				<view class='settlement' style='z-index:100' @tap="SubOrder">立即结算</view>
			</view>
		</view>
		<view class="alipaysubmit" v-html="formContent"></view>
		<apopup :show="passengerShow"  @close="passengerShow=false" border-radius="14" height="650" :closeable="true" z-index='10'>
			<view style="margin-top: 10px;margin-left: 10px;">
				<view class="" style="font-weight: 600;font-size: 18px;">
					选择游客
				</view>
				<navigator url="/pages/add_passenger/index">
					<view class="" style="border-radius: 20px;height: 35px;line-height: 35px;width: 90%;color: #2979ff;margin: 15px;background-color: #e5f9ff;text-align: center;">
						<text class="iconfont iconjia" style="margin-right: 5px;"></text> 新增游客
					</view>
				</navigator>
				
				<scroll-view class="" scroll-y="true" style="height: 400rpx;">
					
					<view  class="" v-for="(item, index) in passengerList" :key="index">
						<view class="row-center" style="margin: 5px 12px;">
							<text @click="editPassenger(item)"  class="iconfont icon-xiugai" style="font-size: 25px;color: #007AFF;margin-right: 15px;"></text>
							<text style="font-size: 14px;color: #000000;font-weight: 600;width: 70px;">{{item.name}}</text>
							<text style="color: #909090;font-size: 12px;margin: 0 5px;margin-right: 25px;">{{item.idCard.substr(0,4) + "**********" + item.idCard.substr(14),}}</text>
							<view class="" style="width: 40px;height: 20px;background-color: #e4f4ff;color: #b5cdff;text-align: center;margin-right: 10px;">
								{{item.type==1?'成人':'儿童'}}
							</view>
							<view @click="selectPassenger(index)"  v-if="item.check" class="iconfont icon-duigouxiao" style="margin-left: 12px;font-size: 25px;color: #007AFF;">
								
							</view>
							<view @click="selectPassenger(index)"  v-else class="iconfont icon-duigou" style="margin-left: 12px;font-size: 25px;color: #a1a399;">
								
							</view>
						
						</view>
						<view v-if="index!=(passengerList.length-1)" class="separation-line" style="margin: 12px;">
							
						</view>
					</view>
								
					
				</scroll-view>
				
			</view>
		</apopup>	
		<apopup  :show="calendarShow" height="900" @close="calendarShow=false"  border-radius="20">
			<calendar  :salesDates="salesDates" @callback="dateChange" >
			</calendar>
		</apopup>
		<couponListWindow :coupon='coupon' @ChangCouponsClone="ChangCouponsClone" :openType='openType' @ChangCoupons="ChangCoupons" :orderShow="orderShow"></couponListWindow>
		<addressWindow ref="addressWindow" @changeTextareaStatus="changeTextareaStatus" :address='address'
			:pagesUrl="pagesUrl" @OnDefaultAddress="OnDefaultAddress"  @OnChangeAddress="OnChangeAddress" @changeClose="changeClose"></addressWindow>
		<!-- #ifdef MP -->
		<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
		<!-- #endif -->
		<home></home>
	</view>
</template>
<script>

	import {
		//orderConfirm,
		getCouponsOrderPrice,
		orderCreate,
		postOrderComputed,
		orderPay,
		wechatQueryPayResult,
		loadPreOrderApi
	} from '@/api/order.js';
	import {getAddressList,getAddressDetail,getPassengerList, getAddressDefault} from '@/api/user.js';
	import {openPaySubscribe,openOrderSubscribe} from '@/utils/SubscribeMessage.js';
	import {storeListApi} from '@/api/store.js';
	import {CACHE_LONGITUDE,CACHE_LATITUDE} from '@/config/cache.js';
	import couponListWindow from '@/components/couponListWindow';
	import addressWindow from '@/components/addressWindow';
	import orderGoods from '@/components/orderGoods';
	import home from '@/components/home';
	import {toLogin} from '@/libs/login.js';
	import {mapGetters} from "vuex";
	// #ifdef MP
	import authorize from '@/components/Authorize';
	// #endif
	import {Debounce, isNumber} from '@/utils/validate.js'
	import {apopup} from '@/components/a-popup/index.vue'
	import calendar from '@/components/calendar/index'
	
	let app = getApp();
	export default {
		components: {
			couponListWindow,
			addressWindow,
			orderGoods,
			apopup,
			calendar,
			home,
			// #ifdef MP
			authorize
			// #endif
		},
		onReady() {
			// this.$nextTick(function() {
			// 	// #ifdef MP
			// 	setTimeout(res => {
			// 		const menuButton = uni.getMenuButtonBoundingClientRect();
			// 		const query = uni.createSelectorQuery().in(this);
			// 		query.select('#home')
			// 			.boundingClientRect(data => {
			// 				this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
			// 			})
			// 			.exec();
			// 	},500)
			// 	// #endif
			// });
		},
		data() {
			return {
				selectDate: '',
				startDate:'',
				selectDayBean:{date:'',week:''},
				calendarShow: false,
				salesDates:[],
				info: {
					lunar: true,
					range: true,
					insert: false,
					selected: []
				},
				isRefresh:false,
				flag:0,
				passengerShow: false,
				peopleNum: 1,
				passengerList:[
				],
				isPassenger: 0,
				pdType: 1,
				navTitle: '提交订单',
				navH:"",
				homeTop: 20,
				orderShow: 'orderShow', //下单页面使用优惠券组件不展示tab切换页
				textareaStatus: true,
				//支付方式
				//支付方式
				cartArr: [
					// #ifdef MP-WEIXIN || APP-PLUS
					{
						"name": "微信支付",
						"icon": "icon-weixin2",
						value: 'weixin',
						title: '微信快捷支付',
						payStatus: 1,
					},
					// #endif
					// #ifdef MP-ALIPAY || APP-PLUS
					{
						"name": "支付宝支付",
						"icon": "icon-zhifubao",
						value: 'alipay',
						title: '支付宝快捷支付',
						payStatus: 1,
					},
					
					 // #endif
					{
						"name": "余额支付",
						"icon": "icon-yuezhifu",
						value: 'yue',
						title: '可用余额:',
						payStatus: 1,
					},
					
					
				],
				payType: 'weixin', //支付方式
				openType: 1, //优惠券打开方式 1=使用
				active: 0, //支付方式切换
				coupon: {
					coupon: false,
					list: [],
					statusTile: '立即使用'
				}, //优惠券组件
				address: {
					address: false,
					addressId: 0
				}, //地址组件
				addressInfo: {}, //地址信息
				addressId: 0, //地址id
				couponId: 0, //优惠券id
				cartId: '', //购物车id
				userInfo: {}, //用户信息
				mark: '', //备注信息
				couponTitle: '请选择', //优惠券
				coupon_price: 0, //优惠券抵扣金额
				useIntegral: false, //是否使用积分
				integral_price: 0, //积分抵扣金额
				integral: 0,
				ChangePrice: 0, //使用积分抵扣变动后的金额
				formIds: [], //收集formid
				status: 0,
				is_address: false,
				toPay: false, //修复进入支付时页面隐藏从新刷新页面
				shippingType: 0,
				system_store: {},
				storePostage: 0,
				contacts: '',
				contactsTel: '',
				mydata: {},
				storeList: [],
				store_self_mention: 0,
				cartInfo: [],
				priceGroup: {},
				animated: false,
				totalPrice: 0,
				integralRatio: "0",
				pagesUrl: "",
				orderKey: "",
				// usableCoupon: {},
				offlinePostage: "",
				isAuto: false, //没有授权的不会自动授权
				isShowAuth: false, //是否隐藏授权
				payChannel: '',
				news: true,
				again: false,
				addAgain: false,
				bargain: false, //是否是砍价
				combination: false, //是否是拼团
				secKill: false, //是否是秒杀
				orderInfoVo: {},
				addressList: [], //地址列表数据
				orderProNum: 0,
				preOrderNo: '', //预下单订单号
				theme:app.globalData.theme,
				formContent:''
			};
		},
		computed:{
			...mapGetters(['isLogin', 'systemPlatform', 'productType']),
			markNum(){
				let markNum = 0;
				if(this.mark){
					markNum = 150 - this.mark.length
					return markNum
				}
			}
		},
		watch: {
			isLogin: {
				handler: function(newV, oldV) {
					if (newV) {
						this.getloadPreOrder();
						this.getaddressInfo();
					}
				},
				deep: true
			}
		},
		onLoad(options) {
			// #ifdef MP
			this.homeTop = 144
			// #endif
			// #ifndef MP
			this.navH = 96;
			// #endif
			
			
			// #ifdef H5
			this.payChannel = this.$wechat.isWeixin() ? 'public' : 'weixinh5';
			// #endif
			// #ifdef MP-WEIXIN
			this.payChannel = 'routine';
			this.navH = app.globalData.navHeight;
			// #endif
			// #ifdef MP-ALIPAY
			this.payChannel = 'routineAlipay';
			this.payType = 'alipay';
			this.navH = app.globalData.navHeight;
			// #endif
			
			// #ifdef APP-PLUS
			this.payChannel = this.systemPlatform === 'ios' ? 'weixinAppIos' : 'weixinAppAndroid';
			// #endif
            this.preOrderNo = options.preOrderNo || 0;
			this.addressId = options.addressId || 0;
			this.is_address = options.is_address ? true : false;
			if (this.isLogin) {
				this.getaddressInfo();
				this.getloadPreOrder();
				this.initPassengerList()
			} else {
				toLogin();
			}
		},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			let _this = this
			// wx.getLaunchOptionsSync 
			this.textareaStatus = true;
			if (this.isLogin && this.toPay == false) {
				this.getaddressInfo();
				
			}

			uni.$on("handClick", res => {
				if (res) {
					_this.system_store = res.address
				}
				// 清除监听
				uni.$off('handClick');
			})
			if(this.isLogin ){
				var pages = getCurrentPages();
				var currPage = pages[pages.length - 1]; //当前页面
				// #ifdef MP
				let res = currPage.data.isRefresh;
				//#endif
				// #ifdef H5
				let res = currPage.isRefresh;
				//#endif
				// #ifdef  APP-PLUS
				let res = currPage.isRefresh;
				//#endif	
				if(res) {
					this.initPassengerList()
					this.isRefresh = false
				}
				this.initPassengerList()
			}
			// let pages = getCurrentPages();
			// let currPage = pages[pages.length - 1]; //当前页面
			// if (currPage.data.storeItem) {
			// 	let json = currPage.data.storeItem;
			// 	this.$set(this, 'system_store', json);
			// }
		},
		methods: {
			/***选择日期**/
			selectDay:function(item){
				let that = this
				that.salesDates.forEach(function(res,index){
					res.selected = false
					if(res.date == item.date){
						res.selected = true
						that.selectDayBean = res
						that.flag++		
					}
				})
				// this.$emit('selectedDaysVal', that.salesDates);
				// this.$emit('ChangeSelectDay', that.selectDayBean.dateStr);
				that.selectDate = that.selectDayBean.dateStr
			},
			dateChange:function(date){
				this.selectDayCalendar(date)
				this.calendarShow =false
				
			},
			selectDayCalendar:function(item){
				let that = this
				that.salesDates.forEach(function(res,index){
					that.salesDates[index].selected = false
				
					if(res.dateStr == item.startStr.dateStr){
						that.salesDates[index].selected = true
						that.selectDayBean = res		
					} else{
						return false;
					}
				})
				// this.$emit('selectedDaysVal', that.salesDates);
				// this.$emit('ChangeSelectDay', that.selectDayBean.dateStr);
				that.selectDate = that.selectDayBean.dateStr
			},
			
			/**选择乘客*/
			selectPassenger:function(index){
				let that = this
			
				var passenger = this.passengerList[index]
							
			
				passenger.check = !passenger.check				
				var passNum = 0;
				this.passengerList.forEach(function(res){
					if(res.check==true){
						passNum++
					}
				})			
				if(passNum > this.peopleNum){
					this.passengerList[index].check = false
					uni.showModal({
					    title: '温馨提示',
					    content: '最多添加'+this.peopleNum+'个游客，请增加您的购票张数',
						showCancel: false,
						confirmText: '我已知晓',
					    success: function (res) {
					        if (res.confirm) {
					            console.log('用户点击确定');
					        } else if (res.cancel) {
					            console.log('用户点击取消');
					        }
					    }
					});
					return
				}  else{
					this.flag++
				}
			},
			
			delectPassenger:function(index){
				this.passengerList[index].check = false
				this.flag++
			},
			
			editPassenger:function(item){
				uni.navigateTo({
					url:'/pages/add_passenger/index?id='+item.id+'&idCard='+item.idCard+'&name='+item.name+'&phone='+item.phone+'&type='+item.type
				})
			},
			initPassengerList:function(){
				let that = this
				getPassengerList().then(res => {
					that.passengerList = res.data
					that.passengerList.forEach(function(res,index) {
						that.passengerList[index].check = false
					})
				})
			},
			CartNumDes: function() {
				var that = this
				if(that.peopleNum <= 1){
					this.peopleNum = 1
					return
				}
				that.peopleNum--
				if(that.passengerList.length > 0){
					that.passengerList.forEach(function(res,index) {
						that.passengerList[index].check = false
					})
				}
				if(this.peopleNum > 0){
					this.computedPrice()
				}
				 
			},
			bindCode: function(e) {
				var that = this
			
				if(!isNumber(e)){
					that.$set(that,"peopleNum",1)
					return
				}
				if(e > 0){
					this.peopleNum = e
					this.computedPrice()
				}
			},
			CartNumAdd: function() {
				this.peopleNum++
				this.computedPrice()
			},
			
			
			// 订单详情
			getloadPreOrder: function() {
				loadPreOrderApi(this.preOrderNo).then(res => {
					var that= this
					let orderInfoVo = res.data.orderInfoVo;
					this.orderInfoVo = orderInfoVo;
					this.cartInfo = orderInfoVo.orderDetailList;
					this.orderProNum = orderInfoVo.orderProNum;
					this.address.addressId = this.addressId ? this.addressId :orderInfoVo.addressId;
					// 区分旅游产品 是否需要实名 收货地址
					// this.pdType = this.orderInfoVo.orderDetailList[0].pdType
					this.$set(this, 'pdType', orderInfoVo.orderDetailList[0].pdType?orderInfoVo.orderDetailList[0].pdType:1);
					this.$set(this, 'isPassenger', orderInfoVo.orderDetailList[0].isPassenger);
					let  datrStr = orderInfoVo.orderDetailList[0].salesDates
					
					if(datrStr){
						that.$set(that, 'salesDates', JSON.parse(datrStr));
					} else {
						that.$set(that, 'salesDates', []);
					}
					that.salesDates.forEach(function(res,index){
						that.salesDates[index].price = that.cartInfo?that.cartInfo[0].price:''
					})
					
					if(this.pdType != 1){
						this.shippingType = 2
					}
					
					this.cartArr[1].title = '可用余额:' + orderInfoVo.userBalance;
					this.cartArr[1].payStatus = parseInt(res.data.yuePayStatus) === 1 ? 1 : 2;
					this.cartArr[0].payStatus = parseInt(res.data.payWeixinOpen) === 1 ? 1 : 0;
					// #ifndef MP
					this.cartArr[2].payStatus = parseInt(res.data.aliPayStatus) === 1 ? 1 : 2;
					// #endif
					// #ifdef H5
					if(this.$wechat.isWeixin()) this.cartArr.pop();
					// #endif
					this.store_self_mention = res.data.storeSelfMention == 'true'&& this.productType === 'normal' ? true : false;
					//调用子页面方法授权后执行获取地址列表
					this.$nextTick(function() {
						this.$refs.addressWindow.getAddressList();
					})
				}).catch(err => {
					console.log(111,err)
					return this.$util.Tips({
						title: err
					});
					// uni.navigateTo({
					// 	url:'/pages/users/order_list/index'
					// });
				})
			},
			/**
			 * 授权回调事件
			 * 
			 */
			onLoadFun: function() {
				this.getaddressInfo();
				//调用子页面方法授权后执行获取地址列表
				// this.$scope.selectComponent('#address-window').getAddressList();
			},
			/**
			 * 获取门店列表数据
			 */
			getList: function() {
				let longitude = uni.getStorageSync("user_longitude"); //经度
				let latitude = uni.getStorageSync("user_latitude"); //纬度
				let data = {
					latitude: latitude, //纬度
					longitude: longitude, //经度
					page: 1,
					limit: 10
				}
				storeListApi(data).then(res => {
					let list = res.data.list || [];
					this.$set(this, 'storeList', list);
					this.$set(this, 'system_store', list[0]);
				}).catch(err => {
					return this.$util.Tips({
						title: err
					});
				})
			},
			// 关闭地址弹窗；
			changeClose: function() {
				this.$set(this.address, 'address', false);
			},
			/*
			 * 跳转门店列表
			 */
			showStoreList: function() {
				let _this = this
				if (this.storeList.length > 0) {
					uni.navigateTo({
						url: '/pages/users/goods_details_store/index'
					})
				}
			},
			// 计算订单价格
			computedPrice: function() {
				let shippingType = this.shippingType;
				postOrderComputed({
					addressId: this.address.addressId,
					useIntegral: this.useIntegral ? true : false,
					couponId: this.couponId,
					shippingType: parseInt(shippingType) + 1,
					peopleNum: this.peopleNum?this.peopleNum:0,
					preOrderNo: this.preOrderNo
				}).then(res => {
					let data = res.data;
					this.orderInfoVo.couponFee = data.couponFee;
					//赋值操作，userIntegral 当前积分，surplusIntegral 剩余积分
					this.orderInfoVo.userIntegral = data.surplusIntegral;
					this.orderInfoVo.deductionPrice = data.deductionPrice;
					this.orderInfoVo.freightFee = data.freightFee;
					this.orderInfoVo.payFee = data.payFee;
					this.orderInfoVo.proTotalFee = data.proTotalFee;
					this.orderInfoVo.useIntegral = data.useIntegral;
					this.orderInfoVo.usedIntegral = data.usedIntegral;
					this.orderInfoVo.surplusIntegral = data.surplusIntegral;
					
					
					//this.orderInfoVo.userIntegral = data.userIntegral;
				}).catch(err => {
					return this.$util.Tips({
						title: err
					});
				});
			},
			addressType: function(e) {
				let index = e;
				this.shippingType = parseInt(index);
				this.computedPrice();
				if (index == 1) this.getList();
			},
			bindPickerChange: function(e) {
				let value = e.detail.value;
				this.shippingType = value;
				this.computedPrice();
			},
			ChangCouponsClone: function() {
				this.$set(this.coupon, 'coupon', false);
			},
			changeTextareaStatus: function() {
				for (let i = 0, len = this.coupon.list.length; i < len; i++) {
					this.coupon.list[i].use_title = '';
					this.coupon.list[i].is_use = 0;
				}
				this.textareaStatus = true;
				this.status = 0;
				this.$set(this.coupon, 'list', this.coupon.list);
			},
			/**
			 * 处理点击优惠券后的事件
			 * 
			 */
			ChangCoupons: function(e) {
				// this.usableCoupon = e
				// this.coupon.coupon = false
				let index = e,
					list = this.coupon.list,
					couponTitle = '请选择',
					couponId = 0;
				for (let i = 0, len = list.length; i < len; i++) {
					if (i != index) {
						list[i].use_title = '';
						list[i].isUse = 0;
					}
				}
				if (list[index].isUse) {
					//不使用优惠券
					list[index].use_title = '';
					list[index].isUse = 0;
				} else {
					//使用优惠券
					list[index].use_title = '不使用';
					list[index].isUse = 1;
					couponTitle = list[index].name;
					couponId = list[index].id;
				}
				this.couponTitle = couponTitle;
				this.couponId = couponId;
				this.$set(this.coupon, 'coupon', false);
				this.$set(this.coupon, 'list', list);
				this.computedPrice();
			},
			/**
			 * 使用积分抵扣
			 */
			ChangeIntegral: function() {
				this.useIntegral = !this.useIntegral;
				this.computedPrice();
			},
			/**
			 * 首次进页面展示默认地址
			 */
			OnDefaultAddress: function(e) {
				this.addressInfo = e;
				this.address.addressId = e.id;
				if(this.addressInfo) this.computedPrice();
			},
			/**
			 * 选择地址后改变事件
			 * @param object e
			 */
			OnChangeAddress: function(e) {
				this.addressInfo = e;
				this.address.addressId = e.id;
				this.textareaStatus = true;
				//this.orderInfoVo.addressId = e;
				this.address.address = false;
				//this.getaddressInfo();
				this.computedPrice();
			},
			bindHideKeyboard: function(e) {
				this.mark = e.detail.value;
			},
			/**
			 * 获取当前金额可用优惠券
			 * 
			 */
			getCouponList: function() {
				getCouponsOrderPrice(this.preOrderNo).then(res => {
					this.$set(this.coupon, 'list', res.data);
					this.openType = 1;
				});
			},
			/*
			 * 获取默认收货地址或者获取某条地址信息
			 */
			getaddressInfo: function() {
				let that = this;
				if (that.addressId) {
					getAddressDetail(that.addressId).then(res => {
						if (res.data) {
							res.data.isDefault = parseInt(res.data.isDefault);
							that.addressInfo = res.data || {};
							that.addressId = res.data.id || 0;
							that.address.addressId = res.data.id || 0;
						}
					})
				} else {
					getAddressDefault().then(res => {
						if (res.data) {
							res.data.isDefault = parseInt(res.data.isDefault);
							that.addressInfo = res.data || {};
							that.addressId = res.data.id || 0;
							that.address.addressId = res.data.id || 0;
						}
					})
				}
			},
			payItem: function(e) {
				let that = this;
				let active = e;
				that.active = active;
				that.animated = true;
				that.payType = that.cartArr[active].value;
				// #ifdef H5
				if(that.payType == 'alipay' && this.$wechat.isWeixin() == true){
					that.payChannel = 'public';
				}else if(that.payType == 'alipay' && this.$wechat.isWeixin() == false){
					that.payChannel = 'weixinh5';
				}
				// #endif
				// #ifdef APP-PLUS
				if(that.payType == 'alipay'){
					that.payChannel = 'appAliPay';
				}
				// #endif
				// #ifdef MP-ALIPAY
				if(that.payType == 'alipay'){
					that.payChannel = 'routineAliPay';
				}
				// #endif
				//that.computedPrice();
				setTimeout(function() {
					that.car();
				}, 500);
			},
			couponTap: function() {
				this.coupon.coupon = true;
				if(!this.coupon.list.length)this.getCouponList();
			},
			car: function() {
				let that = this;
				that.animated = false;
			},
			onAddress: function() {
				let that = this;
				that.textareaStatus = false;
				that.address.address = true;
				that.pagesUrl = '/pages/users/user_address_list/index?preOrderNo='+ this.preOrderNo;
			},
			realName: function(e) {
				this.contacts = e.detail.value;
			},
			phone: function(e) {
				this.contactsTel = e.detail.value;
			},
			payment: function(data) {
				let that = this;
				orderCreate(data).then(res => {
					that.getOrderPay(res.data.orderNo, '支付成功');
				}).catch(err => {
					uni.hideLoading();
					return that.$util.Tips({
						title: err
					}, '/pages/users/order_list/index'
					);
				});
			},
			getOrderPay: function(orderNo, message) {
				let that = this; 
				let goPages = '/pages/users/order_pay_status/index?order_id=' + orderNo;
				orderPay({
					orderNo: orderNo,
					payChannel: that.payChannel,
					payType: that.payType,
					scene: that.productType==='normal'? 0 :1177 //下单时小程序的场景值
				}).then(res => {
					let jsConfig = res.data.jsConfig;
					switch (res.data.payType) {
						case 'weixin':
							that.weixinPay(jsConfig,orderNo,goPages);
							break;
						case 'yue':
							uni.hideLoading();
							return that.$util.Tips({
								title: message
							}, {
								tab: 5,
								url: goPages + '&status=1'
							});
							break;
						case 'weixinh5':
							uni.hideLoading();
							setTimeout(() => {
								location.href = jsConfig.mwebUrl + '&redirect_url=' + window.location.protocol + '//' + window.location.host +goPages + '&status=1';
							}, 100)
							break;
						case 'alipay':
							//#ifdef H5
							if (this.$wechat.isWeixin()) {
								uni.redirectTo({
									url: `/pages/users/alipay_invoke/index?id=${orderNo}&type=order`
								});
							} else {
								//h5支付
								uni.hideLoading();
								that.formContent = res.data.alipayRequest;
								uni.setStorage({key: 'orderNo', data:orderNo});
								that.$nextTick(() => {
									document.forms['punchout_form'].submit();
								})
							}
							//#endif
							// #ifdef APP-PLUS
							let alipayRequest = res.data.alipayRequest;
							uni.requestPayment({
								provider: 'alipay',
								orderInfo: alipayRequest,
								success: (e) => {
									uni.showToast({
										title: "支付成功"
									})
									setTimeout(res => {
										// uni.navigateTo({
										// 	url:'/pages/users/alipay_return/alipay_return?out_trade_no=' + orderNo + '&payChannel=' + 'appAlipay'
										// })
										uni.hideLoading();
										return that.$util.Tips(
											{title: '支付成功',icon: 'success'}, 
											{tab: 5,url: goPages},);
									}, 1000) 
								},
								fail: (e) => {
									console.log(e,'失败');
									that.cancelOrder(orderNo)
									return that.$util.Tips({title: '取消支付'});
									
								},
								complete: () => {
									uni.hideLoading();
								},
							});
							// #endif
							// #ifdef MP-ALIPAY
							let alipayRequest = res.data.alipayRequest;
							uni.requestPayment({
								provider: 'alipay',
								orderInfo: alipayRequest,
								success: (e) => {
									uni.showToast({
										title: "支付成功"
									})
									setTimeout(res => {
										// uni.navigateTo({
										// 	url:'/pages/users/alipay_return/alipay_return?out_trade_no=' + orderNo + '&payChannel=' + 'appAlipay'
										// })
										uni.hideLoading();
										return that.$util.Tips(
											{title: '支付成功',icon: 'success'}, 
											{tab: 5,url: goPages},);
									}, 1000) 
								},
								fail: (e) => {
									console.log(e,'失败');
									that.cancelOrder(orderNo)
									return that.$util.Tips({title: '取消支付'});
									// uni.showModal({
									// 	content: "支付失败",
									// 	showCancel: false,
									// 	success: function(res) {
									// 		if (res.confirm) {
									// 			//点击确认的操作
									// 			// uni.navigateTo({
									// 			// 	url:'/pages/users/alipay_return/alipay_return?out_trade_no=' + orderNo + '&payChannel=' + 'appAlipay'
									// 			// })
									// 			uni.hideLoading();
									// 			return that.$util.Tips(
									// 				{title: '支付成功',icon: 'success'}, 
									// 				{tab: 5,url: goPages},);
									// 		}
									// 	}
									// })
								},
								complete: () => {
									uni.hideLoading();
								},
							});
							// #endif
							break;
					}
				}).catch(err => {
					uni.hideLoading();
					return that.$util.Tips({
						title: err
					});
				});
			},
			weixinPay(jsConfig,orderNo,goPages){
				let that = this;
				// #ifdef MP
				uni.requestPayment({
					timeStamp: jsConfig.timeStamp,
					nonceStr: jsConfig.nonceStr,
					package: jsConfig.packages,
					signType: jsConfig.signType,
					paySign: jsConfig.paySign,
					ticket: that.productType==='normal'? null : jsConfig.ticket,
					success: function(ress) {
						uni.hideLoading();
						// openOrderSubscribe().then(()=>{
							
						// })
						
						wechatQueryPayResult(orderNo).then(res => {
							uni.hideLoading();
							console.log("res",res)
							if (that.orderInfoVo.bargainId || that.orderInfoVo.combinationId || that.pinkId || that.orderInfoVo.seckillId){
								return that.$util.Tips(
								{title: '支付成功',icon: 'success'},
								{tab: 4,url: goPages});
							} else {
								return that.$util.Tips(
								{title: '支付成功',icon: 'success'},
								{tab: 5,url: goPages});
							}
						
							
						}).cache(err => {
							uni.hideLoading();
							return that.$util.Tips({
								title: err
							});
						})
					},
					fail: function(e) {
						uni.hideLoading();
						return that.$util.Tips(
						{title: '取消支付'}, 
						{tab: 5,url: goPages + '&status=2'});
					},
					complete: function(e) {
						uni.hideLoading();
						//关闭当前页面跳转至订单状态
						if (e.errMsg == 'requestPayment:cancel') return that.$util.Tips(
							{title: '取消支付'}, 
							{tab: 5,url: goPages + '&status=2'});
					},
				})
				// #endif
				// #ifdef H5
				let data = {
					timestamp: jsConfig.timeStamp,
					nonceStr: jsConfig.nonceStr,
					package: jsConfig.packages,
					signType: jsConfig.signType,
					paySign: jsConfig.paySign
				};
				that.$wechat.pay(data).then(res => {
					if (res.errMsg == 'chooseWXPay:cancel') {
						uni.hideLoading();
						return that.$util.Tips(
						{title: '取消支付'}, 
						{tab: 5,url: goPages + '&status=2'});
					} else {
						wechatQueryPayResult(orderNo).then(res => {
							uni.hideLoading();
							return that.$util.Tips(
							{title: '支付成功',icon: 'success'},
							{tab: 5,url: goPages});
						}).cache(err => {
							uni.hideLoading();
							return that.$util.Tips({
								title: err
							});
						})
					}
				}).cache(res => {
					uni.hideLoading();
					return that.$util.Tips(
					{title: '取消支付'}, 
					{tab: 5,url: goPages + '&status=0'});
				});
				// #endif
				// #ifdef APP-PLUS
				uni.requestPayment({
					provider: 'wxpay',
					orderInfo: {
						"appid": jsConfig.appId, // 微信开放平台 - 应用 - AppId，注意和微信小程序、公众号 AppId 可能不一致
						"noncestr": jsConfig.nonceStr, // 随机字符串
						"package": "Sign=WXPay", // 固定值
						"partnerid": jsConfig.partnerid, // 微信支付商户号
						"prepayid": jsConfig.packages, // 统一下单订单号 
						"timestamp": Number(jsConfig.timeStamp), // 时间戳（单位：秒）
						"sign": this.systemPlatform === 'ios' ? 'MD5' : jsConfig.paySign // 签名，这里用的 MD5 签名
					}, //微信、支付宝订单数据 【注意微信的订单信息，键值应该全部是小写，不能采用驼峰命名】
					success: function(res) {
						wechatQueryPayResult(orderNo).then(res => {
							uni.hideLoading();
							let url = '/pages/user/order_pay_status/index?order_id=' + orderNo +'&msg=支付成功';
							uni.showToast({
								title: "支付成功"
							})
							setTimeout(res => {
								uni.redirectTo({
									url: url
								})
							}, 2000)
						}).cache(err => {
							uni.hideLoading();
							return that.$util.Tips({
								title: err
							});
						})
					},
					fail: function(err) {
						uni.hideLoading();
						let url = '/pages/user/index?order_id=' + orderNo +'&msg=支付失败';
						uni.showModal({
							content: "支付失败",
							showCancel: false,
							success: function(res) {
								if (res.confirm) {
									uni.redirectTo({
										url: url
									})
								}
							}
						})
					},
					complete: (err) => {
						uni.hideLoading();
					}
				});
				// #endif
			},
			SubOrder(e) {
				let that = this,
					data = {};
					
				if(this.pdType != 1&&this.selectDate=='')return that.$util.Tips({
					title: '请选择使用时间'
				});
				
				var isPassengerAll=true,passNum=0;
				var passList = [];
				this.passengerList.forEach(function(res){
					if(res.check==true){
						passNum++
						passList.push(res)
					}
				})
				var tips = "";
	            if(that.isPassenger&&passNum!=that.peopleNum){
					tips = "您还差"+(that.peopleNum - passNum)+'个游客未添加';
				} else if(that.is_passenger&&productInfo.attrInfo.stock<passNum){
					tips = "库存不足";
				}
				if (tips) {
					return that.$util.Tips({
								title: tips
							});
				} 	
				
				if (!that.payType) return that.$util.Tips({
					title: '请选择支付方式'
				});
				if (!that.address.addressId && !that.shippingType&&that.pdType==1) return that.$util.Tips({
					title: '请选择收货地址'
				});
				if (that.shippingType == 1) {
					if (that.contacts == "" || that.contactsTel == "") {
						return that.$util.Tips({
							title: '请填写联系人或联系人电话'
						});
					}
					if (!/^1(3|4|5|7|8|9|6)\d{9}$/.test(that.contactsTel)) {
						return that.$util.Tips({
							title: '请填写正确的手机号'
						});
					}
					if (!/^[\u4e00-\u9fa5\w]{2,16}$/.test(that.contacts)) {
						return that.$util.Tips({
							title: '请填写您的真实姓名'
						});
					}
					if (that.storeList.length == 0) return that.$util.Tips({
						title: '暂无门店,请选择其他方式'
					});
				}
				data = {
					date: that.selectDate,
					peopleNum: that.peopleNum,
					passengerList: passList,
					realName: that.contacts,
					phone: that.contactsTel,
					addressId: that.address.addressId,
					couponId: that.couponId,
					payType: that.payType,
					useIntegral: that.useIntegral,
					preOrderNo: that.preOrderNo,
					mark: that.mark,
					storeId: that.system_store ? that.system_store.id : 0,
					shippingType: that.$util.$h.Add(that.shippingType, 1),
					payChannel: that.payChannel

				};
				if (data.payType == 'yue' && parseFloat(that.userInfo.nowMoney) < parseFloat(that.totalPrice))
					return that.$util.Tips({
						title: '余额不足！'
					});
				uni.showLoading({
					title: '订单支付中'
				});
				// #ifdef MP
				openPaySubscribe().then(() => {
					that.payment(data);
				});
				// #endif
				// #ifndef MP
				that.payment(data);
				// #endif
			}
		}
	}
</script>

<style lang="scss" scoped>
	.font_color{
		@include main_color(theme);
	}
	.price_color{
		@include price_color(theme);
	}
	.line2{
		width: 504rpx;
	}
	.textR {
		text-align: right;
	}

	.order-submission .line {
		width: 100%;
		height: 3rpx;
	}

	.order-submission .line image {
		width: 100%;
		height: 100%;
		display: block;
	}

	.order-submission .address {
		padding: 28rpx;
		background-color: #fff;
		box-sizing: border-box;
	}

	.order-submission .address .addressCon {
		width: 596rpx;
		font-size: 26rpx;
		color: #666;
	}

	.order-submission .address .addressCon .name {
		font-size: 30rpx;
		color: #282828;
		font-weight: bold;
		margin-bottom: 10rpx;
	}

	.order-submission .address .addressCon .name .phone {
		margin-left: 50rpx;
	}

	.order-submission .address .addressCon .default {
		margin-right: 12rpx;
	}

	.order-submission .address .addressCon .setaddress {
		color: #333;
		font-size: 28rpx;
	}

	.order-submission .address .iconfont {
		font-size: 35rpx;
		color: #707070;
	}

	.order-submission .allAddress {
		width: 100%;
		@include index-gradient(theme);
		/* #ifdef MP-WEIXIN || H5*/
		padding: 225rpx 30rpx 0 30rpx;
		/* #endif */
		/* #ifdef APP-PLUS*/
		padding: 100rpx 30rpx 0 30rpx;
		/* #endif */
	}

	.order-submission .allAddress .nav {
		width: 690rpx;
		margin: 0 auto;
	}

	.order-submission .allAddress .nav .item {
		width: 334rpx;
	}

	.order-submission .allAddress .nav .item.on {
		position: relative;
		width: 230rpx;
	}

	.order-submission .allAddress .nav .item.on::before {
		position: absolute;
		bottom: 0;
		content: "快递配送";
		font-size: 28rpx;
		display: block;
		height: 0;
		width: 336rpx;
		border-width: 0 20rpx 80rpx 0;
		border-style: none solid solid;
		border-color: transparent transparent #fff;
		z-index: 2;
		border-radius: 14rpx 36rpx 0 0;
		text-align: center;
		line-height: 80rpx;
	}

	.order-submission .allAddress .nav .item:nth-of-type(2).on::before {
		content: "到店自提";
		border-width: 0 0 80rpx 20rpx;
		border-radius: 36rpx 14rpx 0 0;
	}

	.order-submission .allAddress .nav .item.on2 {
		position: relative;
	}

	.order-submission .allAddress .nav .item.on2::before {
		position: absolute;
		bottom: 0;
		content: "到店自提";
		font-size: 28rpx;
		display: block;
		height: 0;
		width: 401rpx;
		border-width: 0 0 60rpx 60rpx;
		border-style: none solid solid;
		border-color: transparent transparent rgba(255,255,255,0.6);
		border-radius: 36rpx 14rpx 0 0;
		text-align: center;
		line-height: 60rpx;
	}

	.order-submission .allAddress .nav .item:nth-of-type(1).on2::before {
		content: "快递配送";
		border-width: 0 60rpx 60rpx 0;
		border-radius: 14rpx 36rpx 0 0;
	}

	.order-submission .allAddress .address {
		width: 690rpx;
		max-height: 180rpx;
		margin: 0 auto;
	}

	.order-submission .allAddress .line {
		width: 100%;
		margin: 0 auto;
	}

	.order-submission .wrapper .item .discount .placeholder {
		color: #ccc;
	}

	.order-submission .wrapper {
		background-color: #fff;
		margin-top: 15rpx;
	}

	.order-submission .wrapper .item {
		padding: 27rpx 24rpx;
		font-size: 30rpx;
		color: #333333;
		border-bottom: 1px solid #F5F5F5;
	}

	.order-submission .wrapper .item .discount {
		font-size: 30rpx;
		color: #333;
	}

	.order-submission .wrapper .item .discount .iconfont {
		color: #515151;
		font-size: 30rpx;
		margin-left: 15rpx;
	}

	.order-submission .wrapper .item .discount .num {
		font-size: 32rpx;
		margin-right: 20rpx;
	}

	.order-submission .wrapper .item .shipping {
		font-size: 30rpx;
		color: #999;
		position: relative;
		padding-right: 58rpx;
	}

	.order-submission .wrapper .item .shipping .iconfont {
		font-size: 35rpx;
		color: #707070;
		position: absolute;
		right: 0;
		top: 50%;
		transform: translateY(-50%);
		margin-left: 30rpx;
	}

	.order-submission .wrapper .item textarea {
		background-color: #f9f9f9;
		width: auto !important;
		height: 140rpx;
		border-radius: 14rpx;
		margin-top: 30rpx;
		padding: 15rpx;
		box-sizing: border-box;
		font-weight: 400;
	}

	.order-submission .wrapper .item .placeholder {
		color: #ccc;
	}

	.order-submission .wrapper .item .list {
		margin-top: 35rpx;
	}

	.order-submission .wrapper .item .list .payItem {
		border: 1px solid #eee;
		border-radius: 14rpx;
		height: 86rpx;
		width: 100%;
		box-sizing: border-box;
		margin-top: 20rpx;
		font-size: 28rpx;
		color: #282828;
	}

	.order-submission .wrapper .item .list .payItem.on {
		// border-color: #fc5445;
		@include coupons_border_color(theme);
		color: $theme-color;
	}

	.order-submission .wrapper .item .list .payItem .name {
		width: 50%;
		text-align: center;
		border-right: 1px solid #eee;
	}

	.order-submission .wrapper .item .list .payItem .name .iconfont {
		width: 44rpx;
		height: 44rpx;
		border-radius: 50%;
		text-align: center;
		line-height: 44rpx;
		background-color: #fe960f;
		color: #fff;
		font-size: 30rpx;
		margin-right: 15rpx;
	}

	.order-submission .wrapper .item .list .payItem .name .iconfont.icon-weixin2 {
		background-color: #41b035;
	}
	.order-submission .wrapper .item .list .payItem .name .iconfont.icon-zhifubao {
		background-color: #00AAEA;
	}
	.order-submission .wrapper .item .list .payItem .tip {
		width: 49%;
		text-align: center;
		font-size: 26rpx;
		color: #aaa;
	}

	.order-submission .moneyList {
		margin-top: 15rpx;
		background-color: #fff;
		padding: 30rpx;
	}

	.order-submission .moneyList .item {
		font-size: 28rpx;
		color: #282828;
	}

	.order-submission .moneyList .item~.item {
		margin-top: 20rpx;
	}

	.order-submission .moneyList .item .money {
		color: #666666;
	}

	.order-submission .footer {
		width: 100%;
		height: 100rpx;
		background-color: #fff;
		padding: 5px 30rpx;
		font-size: 28rpx;
		color: #333;
		box-sizing: border-box;
		position: fixed;
		bottom: 0;
		left: 0;
		height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
		z-index: 999;
	}

	.order-submission .footer .settlement {
		font-size: 30rpx;
		color: #fff;
		width: 240rpx;
		height: 70rpx;
		@include main_bg_color(theme);
		border-radius: 50rpx;
		text-align: center;
		line-height: 70rpx;
	}

	.footer .transparent {
		opacity: 0
	}
	/deep/ checkbox .uni-checkbox-input.uni-checkbox-input-checked {
		@include main_bg_color(theme);
		border: none !important;
		color: #fff!important
	}
	
	/deep/ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
		@include main_bg_color(theme);
		border: none !important;
		color: #fff!important;
		margin-right: 0 !important;
	}
	.no-active{
		width: 27%;
		height: 35px;
		border-radius: 5px;
		border: 1px solid #e5e5e5;
		margin: 0 15px 10px 0;
		text-align: center;
		line-height: 35px;
		position: relative;
	}
	.in-active{
		@include coupons_border_color(theme);
		width: 27%;
		height: 35px;
		border-radius: 5px;
		// border: 1px solid #0c79ff;
		margin: 0 15px 10px 0;
		text-align: center;
		line-height: 35px;
		position: relative;
	}
	.gou {
		@include main_bg_color(theme);
		position: absolute;
		float: right;
		right: 0;
		// background-color: #0c79ff;
		width: 15px;
		height: 10px;
		line-height: 10px;
		bottom: 0;
		border-bottom-right-radius: 3px;
		border-top-left-radius: 5px;
	}
	.gou2 {
		@include main_bg_color(theme);
		position: absolute;
		float: right;
		right: 0;
		// background-color: #0c79ff;
		width: 15px;
		height: 10px;
		line-height: 10px;
		bottom: 0;
		border-bottom-right-radius: 3px;
		border-top-left-radius: 5px;
	}
	.listn{
		 justify-content: space-around;
	}
	.listn .itemn2 {
		border: 1px solid #F2F2F2;
		font-size: 26rpx;
		// padding: 7rpx 33rpx;
		border-radius: 5px;
		border: 1px solid #e5e5e5;
		margin: 20rpx 0 0 14rpx;
		// width: 22%;
		text-align: center;
		position: relative;
	}
	.listn .itemn2.on {
		@include main_color(theme);
		@include coupons_border_color(theme);
		// @include cate-two-btn(theme);
	}
	
	.weekday{
	   margin: 7rpx 34rpx;
	}

	.more_date{
		font-size: 26rpx;
		color: #282828;
		// padding: 7rpx 34rpx;
		border-radius: 5px;
		border: 1px solid #e5e5e5;
		margin: 20rpx 0 0 14rpx;
		
		// width: 22%;
		text-align: center;
	}
	.cart {
		// margin-top: 50rpx;
		// margin-bottom: 30rpx;
		// padding: 0 30rpx;
		padding-bottom: 15px;
	}
	
	.cart .title {
		font-size: 30rpx;
		color: #999;
	}
	
	.cart .carnum {
		height: 54rpx;
	}
	
	.cart .carnum view {
		// border: 1px solid #a4a4a4;
		width: 84rpx;
		text-align: center;
		height: 100%;
		line-height: 54rpx;
		color: #282828;
		font-size: 45rpx;
	}
	
	.cart .carnum .reduce {
		border-right: 0;
		border-radius: 6rpx 0 0 6rpx;
		line-height: 48rpx;
	}
	
	.cart .carnum .reduce.on {
		// border-color: #e3e3e3;
		color: #DEDEDE;
		font-size: 44rpx;
	}
	
	.cart .carnum .plus {
		border-left: 0;
		border-radius: 0 6rpx 6rpx 0;
		line-height: 46rpx;
	}
	
	.cart .carnum .plus.on {
		border-color: #e3e3e3;
		color: #dedede;
	}
	
	.cart .carnum .num {
		background: rgba(242, 242, 242, 1);
		color: #282828;
		font-size: 28rpx;
		border-radius: 12rpx;
		line-height: 29px;
		height: 54rpx;
	
		input {
			display: -webkit-inline-box;
		}
	}
</style>
